/**
 * @遮罩层
 */
import { Input, Modal } from 'antd';
import { useState } from 'react';
interface IProps {
  flag: boolean,
  cancelMethod:(obj:any|null)=>void
}
const ArticleList: React.FC<IProps> = (props) => {
  const [name,setname] = useState("")
  const [email,setemail] = useState("")
  //点击
  const handleOk = () => {
    props.cancelMethod({name,email})
    setname("")
    setemail("")
  };
  const handleCancel = () => {
    props.cancelMethod(null)
    setname("")
    setemail("")
  };
  return <Modal title="请设置你的信息" cancelText="取消" okText="设置" visible={props.flag} onOk={handleOk} onCancel={handleCancel} >
    <p>名称:<Input value={name} onChange={(e)=>setname(e.target.value)}/></p>
    <p>邮箱<Input value={email} onChange={(e)=>setemail(e.target.value)}/></p>
  </Modal>
}

export default ArticleList;
